<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" lang="zh-CN" xml:lang="zh-CN">
<head><meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
    <title>6.51. Sysklogd-1.4.1</title>
    <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type="text/css" media="print" />
<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d286c55b63a3c54a1e43d10d4c203e75"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</head>
  <body id="lfs" class="6.2">
    <div class="navheader">
      <div class="headertitles">
        <h4>Linux From Scratch - 版本 6.2</h4>
        <h3>第六章 安装系统基础软件</h3>
      </div>
      <ul class="headerlinks">
        <li class="prev">
          <a accesskey="p" href="shadow.html" title="Shadow-4.0.15">后退</a>
          <p>Shadow-4.0.15</p>
        </li>
        <li class="next">
          <a accesskey="n" href="sysvinit.html" title="Sysvinit-2.86">前进</a>
          <p>Sysvinit-2.86</p>
        </li>
        <li class="up"><a accesskey="u" href="chapter06.html" title="第六章 安装系统基础软件">上一级</a></li>
        <li class="home"><a accesskey="h" href="../index.html" title="Linux From Scratch - 版本 6.2">首页</a></li>
      </ul>
    </div>
    <div class="wrap">
      <div class="titlepage">
        <h1 class="sect1">6.51. Sysklogd-1.4.1</h1>
      </div>
      <div class="package">
        <p>Sysklogd 包含记录系统日志信息的程序，比如内核处理意外事务的日志。</p>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong><span class="segtitle">预计编译时间：</span></strong> <span class="seg">少于 0.1 SBU</span>
            </div>
            <div class="seg">
              <strong><span class="segtitle">所需磁盘空间：</span></strong> <span class="seg">0.6 MB</span>
            </div>
          </div>
        </div>
      </div>
      <div class="installation">
        <div class="titlepage">
          <h2 class="sect2">6.51.1. 安装 Sysklogd</h2>
        </div>
        <p>下面的补丁修正了许多问题，包括在2.6系列的内核上编译 Sysklogd 会遇到的问题：</p>
        <pre class="userinput"><kbd class="command">patch -Np1 -i ../sysklogd-1.4.1-fixes-1.patch</kbd></pre>
        <p>下面的patch使 sysklogd 逐字的对待日志信息中0x80--0x9f段的字符，而不是采用八进制进行替换。未打patch的sysklogd在UTF-8编码下会损害日志信息：</p>
        <pre class="userinput"><kbd class="command">patch -Np1 -i ../sysklogd-1.4.1-8bit-1.patch</kbd></pre>
        <p>编译软件包：</p>
        <pre class="userinput"><kbd class="command">make</kbd></pre>
        <p>这个软件包没有附带测试程序。</p>
        <p>安装软件包：</p>
        <pre class="userinput"><kbd class="command">make install</kbd></pre>
      </div>
      <div class="configuration">
        <div class="titlepage">
          <a id="conf-sysklogd" name="conf-sysklogd"></a>
          <h2 class="sect2">6.51.2. 配置 Sysklogd</h2>
        </div>
        <p>创建一个新的 <tt class="filename">/etc/syslog.conf</tt> 文件：</p>
        <pre class="userinput"><kbd class="command">cat &gt; /etc/syslog.conf &lt;&lt; "EOF"
<tt class="literal"># Begin /etc/syslog.conf

auth,authpriv.* -/var/log/auth.log
*.*;auth,authpriv.none -/var/log/sys.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
*.emerg *

# End /etc/syslog.conf</tt>
EOF</kbd></pre>
      </div>
      <div class="content">
        <div class="titlepage">
          <a id="contents-sysklogd" name="contents-sysklogd"></a>
          <h2 class="sect2">6.51.3. Sysklogd 的内容</h2>
        </div>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong><span class="segtitle">安装的程序：</span></strong> <span class="seg">klogd, syslogd</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3><a id="id3694698" name="id3694698"></a>简要描述</h3>
          <table border="0">
            <col align="left" valign="top" />
            <tbody>
              <tr>
                <td><a id="klogd" name="klogd"></a><span class="term"><span><strong class="command">klogd</strong></span></span></td>
                <td><p>一个系统守护进程，截获并且记录下 LINUX 内核日志信息。</p></td>
              </tr>
              <tr>
                <td><a id="syslogd" name="syslogd"></a><span class="term"><span><strong class="command">syslogd</strong></span></span></td>
                <td><p>记录下系统里所有提供日志记录的程序给出的日志和信息内容。每一个被记录的消息至少包含时间戳和主机名(通常还包括程序名)。</p></td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="shadow.html" title="Shadow-4.0.15">后退</a>
          <p>Shadow-4.0.15</p>
        </li>
        <li class="next">
          <a accesskey="n" href="sysvinit.html" title="Sysvinit-2.86">前进</a>
          <p>Sysvinit-2.86</p>
        </li>
        <li class="up"><a accesskey="u" href="chapter06.html" title="第六章 安装系统基础软件">上一级</a></li>
        <li class="home"><a accesskey="h" href="../index.html" title="Linux From Scratch - 版本 6.2">首页</a>.
        </li>
      </ul>
    </div>
</body></html>
